/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.cesupa.cabcc.entity;

import java.io.Serializable;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;

/**
 *
 * @author yuri
 */
@Entity
@DiscriminatorValue("membro")
@NamedQueries({
    @NamedQuery(name="Membro.findByLogin", query="SELECT m FROM Membro m WHERE m.login = :login"),
    @NamedQuery(name="Membro.findByCargo", query="SELECT m FROM Membro m WHERE m.cargo = :cargo"),
    @NamedQuery(name="Membro.findAll", query="SELECT m FROM Membro m")
})
public class Membro extends Usuario implements Serializable {
    private static final long serialVersionUID = 1L;

    @OneToOne
    private Cargo cargo;
    private String foto = "/img/fotos/default-picture.png";

    @Override
    public String toString() {
        return "br.cesupa.cabcc.entity.Membro[id=" + super.getLogin() + "]";
    }

    /**
     * @return the cargo
     */
    public Cargo getCargo() {
        return cargo;
    }

    /**
     * @param cargo the cargo to set
     */
    public void setCargo(Cargo cargo) {
        this.cargo = cargo;
    }

    /**
     * @return the foto
     */
    public String getFoto() {
        return foto;
    }

    /**
     * @param foto the foto to set
     */
    public void setFoto(String foto) {
        this.foto = foto;
    }

}
